//
//  GYContTableViewCell.m
//  fp
//
//  Created by xingshuai on 2020/11/12.
//

#import "GYContTableViewCell.h"

@interface GYContTableViewCell ()

@property (nonatomic, strong) UILabel *leftLabel;
@property (nonatomic, strong) UILabel *rightLabel;

@end

@implementation GYContTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView  {
    static NSString *identifier = @"XAGYConCellID";
    id cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[self alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self creatViewUI];
    }
    return self;
}

-(void)creatViewUI {
    self.leftLabel = [[UILabel alloc]init];
    self.leftLabel.textColor = [UIColor colorWithHexString:@"#3B3B3B"];
    self.leftLabel.font = [UIFont pingFangSCWithWeight:FontWeightStyleRegular size:16];
    [self.contentView addSubview:self.leftLabel];
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(15);
    }];
    
    self.rightLabel = [[UILabel alloc]init];
    self.rightLabel.textColor = [UIColor colorWithHexString:@"#AFAFAF"];
    self.rightLabel.textAlignment = NSTextAlignmentRight;
    self.rightLabel.font = [UIFont pingFangSCWithWeight:FontWeightStyleRegular size:16];
    [self.contentView addSubview:self.rightLabel];
    [self.rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).offset(-20);
    }];
}

-(void)creatLeftStr:(NSString *)leftStr rightStr:(NSString *)rightStr {
    self.leftLabel.text = leftStr;
    self.rightLabel.text = rightStr;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
